<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title><fmt:message key="titulo-alteracao-produto"/></title>
    <link rel="stylesheet" media="all" href="${pageScope.request.contextPath}css/estilos.css">
    <link rel="stylesheet" media="all" href="${pageScope.request.contextPath}css/bootstrap.css">
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="js/jquery-1.7.1.min.js"><\/script>')</script>
</head>
<body class="body-sessao">
   <div id="image-logo">
     <c:import url="${pageScope.request.contextPath}/imports/fundo.jsp"/>
   </div>
    <div id="logo">
         <c:import url="${pageScope.request.contextPath}/imports/fundo2palha.jsp"/>
      </div>
   <div id="barra-titulo">
     <c:import url="${pageScope.request.contextPath}/imports/barraTituloSessaoUser.jsp"/>
   </div>
   <div id="conteudo-logomarca">
          <img src="img/logomarca.jpg">
          <p>
              <fmt:message key="conteudo-logomarca"/>
          </p>
      </div>
   <div id="formulario">
           <c:if test="${erroCadastroBanco != null}" >
              <font class="erro"><fmt:message key="erroCadastroBanco"/> </font>
           </c:if>
           <c:if test="${erroProcessamento != null}">
		      <font class="erro"><fmt:message key="erroProcessamento" /></font>
		   </c:if>
		   <br>
           <form action="controleprodutos" method="post">
             <input type="hidden" name="acao" value="alterar"/>
             <input type="hidden" name="idBazar" value="${sessionScope.bazar.id}"/>
             <input type="hidden" name="id" value="${requestScope.produto.id}"/>
             <table>
                <tr>
                   <td>
		             <label><fmt:message key="nome" /></label>
				   </td>
				   <td>
					 <input type="text" name="nome" size="35" value="${param.nome != null ? param.nome : requestScope.produto.nome}" /> 
					 <c:if test="${erroNome != null}">
						<font class="erro"><fmt:message key="erroNome" /></font>
					 </c:if> 
				   </td>
                </tr>
                <tr>
                   <td>
		             <label><fmt:message key="preco" /></label>
				   </td>
				   <td>
					 <input type="text" name="preco" size="10" value="${param.preco != null ? param.preco : requestScope.produto.preco}" /> 
					 <c:if test="${erroPreco != null}">
						<font class="erro"><fmt:message key="erroPreco" /></font>
					 </c:if>
					 <c:if test="${excecaoPreco != null}">
						<font class="erro"><fmt:message key="excecaoPreco" /></font>
					 </c:if> 
				   </td>
                </tr>
                <tr>
                  <td>
                     <label><fmt:message key="tempoUso" /></label>
                  </td>
                  <td>
                    <c:forEach items="${temposUso.valores}" var="tempoUso">
                       <input type="radio" name="tempoUso" value="${tempoUso}" <c:if test="${requestScope.produto.tempoUso == tempoUso}"> checked="checked" </c:if> /> <font class="label"> <c:if test="${tempoUso == 'NOVO'}"> <fmt:message key="novo"/> </c:if> <c:if test="${tempoUso =='SEMINOVO'}"> <fmt:message key="seminovo"/> </c:if> <c:if test="${tempoUso == 'USADO'}"> <fmt:message key="usado"/> </c:if> </font>
                    </c:forEach>
                     <c:if test="${erroTempoUso != null}">
                         <font class="erro"><fmt:message key="erroTempoUso"/> </font>
                     </c:if>
                  </td>
                </tr>
                <tr>
                   <td>
		             <label><fmt:message key="descricao" /></label>
				   </td>
				   <td>
					 <input type="text" name="descricao" height="250px" width="50" value="${param.descricao != null ? param.descricao : requestScope.produto.descricao}" /> 
					 <c:if test="${erroDescricao != null}">
						<font class="erro"><fmt:message key="erroDescricao" /></font>
					 </c:if> 
				   </td>
                </tr>
                
                <tr>
                   <td>
		             <label><fmt:message key="quantidadeEstoque" /></label>
				   </td>
				   <td>
					 <input type="text" name="quantidadeEstoque" height="250px" width="50" value="${param.descricao != null ? param.descricao : requestScope.produto.descricao}" /> 
					 <c:if test="${erroQuantidadeEstoque != null}">
						<font class="erro"><fmt:message key="erroQuantidadeEstoque" /></font>
					 </c:if> 
				   </td>
                </tr>
                
                
			</table>
			<br /> <br/>
            <input type="submit" class="btn btn-primary" value='<fmt:message key="enviar"/>'/>
           </form>
        </div>
</body>
</html>